<template>

  <h2>{{ content }}</h2>

  <el-button type="primary" @click="handleSearch">查询</el-button>

  <el-button type="primary" @click="testNode">测试node请求</el-button>


</template>

<script setup lang="ts">
import { ref, reactive, onMounted } from 'vue'
import { nanoid } from 'nanoid'
import axios from 'axios'
import { ElMessage } from 'element-plus'

let content = ref('测试') 

function handleSearch() {
  axios('https://api.uomg.com/api/rand.qinghua?format=json').then(res => {
    // ElMessage('121212')    
    content.value = res.data.content

  }).catch(err => {     

  })
}

function testNode () {

  axios('/home').then(res => {
    debugger
    // content.value = res.data. content
  }).catch(err => {

  })

}

</script>

<style scoped></style>